package com.cskaoyan.market.admin.service.impl;

import com.cskaoyan.market.admin.service.MarketAddressService;
import com.cskaoyan.market.db.domain.MarketAddress;
import com.cskaoyan.market.db.domain.MarketAddressExample;
import com.cskaoyan.market.db.mapper.MarketAddressMapper;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yuanixn2158@163.com
 * @since 2023/05/08 20:42
 */
@Service
public class MarketAddressServiceImpl implements MarketAddressService {
    @Autowired
    private MarketAddressMapper addressMapper;

    @Override
    public List<MarketAddress> getAddressList(int page, int limit, String sort, String order) {
        
        MarketAddressExample marketAddressExample = new MarketAddressExample();
        marketAddressExample.orderBy(sort+ " " +order);
        PageHelper.startPage(page,limit);
        List<MarketAddress> marketAddresses = addressMapper.selectByExample(marketAddressExample);
        
        

        return marketAddresses;
    }

}

